package com.tuu.springjw;

import com.tuu.mapper.UserMapper;
import com.tuu.pojo.User;
import com.tuu.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class SpringBootTest {
    @Autowired
    private UserMapper userMapper;

    @Autowired
    private UserService userService;
    @RequestMapping("/uouo")
    public String test() {

        System.out.println("uouououuouou");
        return "success";
    }


    @RequestMapping("queryall")

    public List<User> queryall(){
        List<User> users = userMapper.selectList(null);
        for (User user : users) {
            System.out.println(user);
        }
        return users;
    }

}
